// 依赖实体类
const SafeString = require('../base/SafeString');
const SafeNumber = require('../base/SafeNumber');
const SafeDatetime = require('../base/SafeDatetime');

// 配置类
const config = require('../../config').config;

/**
 * 实体类 RepairInfo 用于记录新增的维修记录
 */
class RepairInfo {
    constructor(obj) {
        this.deviceId = new SafeNumber(obj.deviceId).value;
        this.time = new SafeDatetime(obj.time).value;                              // 维修时间
        this.description = new SafeString(obj.description, 0, 3000).value;         // 故障描述
        this.processMethod = new SafeString(obj.processMethod, 0, 3000).value;     // 处理方法
        this.changeAccessory = new SafeString(obj.changeAccessory, 0, 3000).value; // 更换配件
        this.repairman = new SafeString(obj.repairman, 0, 3000).value;             // 维修人员
    }
}

module.exports = RepairInfo;